<?php
/**
@Project: 
@Page: 
@Path: 
@Notes: 
**/
class SHML_Tracking
{

	public function tracking_omniture($properties)
	{
		$attributes = $properties['attributes'];
		$f = (strtolower($attributes['function']) == "true") ? TRUE : FALSE;
		$pt = $attributes['title'];
		$ty = $attributes['type'];
		
		$t = '<script language="javascript" type="text/javascript" src="http://www.mcall.com/central/javascript/mtrx/s_code.js"></script>' . "\n";
		$t .= '<script language="javascript" type="text/javascript">' . "\n";
		$t .= '<!--' . "\n";
		$t .= 's.pageName= "' . $pt . ' - The Morning Call - ' . $ty . '.";' . "\n";
		$t .= 's.server="www.mcall.com";' . "\n";
		$t .= 's.campaign="";' . "\n";
		$t .= 'var s_code=s.t();if(s_code)document.write(s_code);' . "\n";
		if ($f) {
			$t .= 'function add_pv(p)' . "\n";
			$t .= '{' . "\n";
			$t .= "\t" . 's.pageName = (p != "" && p !== null) ? p + \'The Morning Call - ' . $ty . '.\' : s.pageName;' . "\n";
			$t .= "\t" . 'var s_code=s.t();if(s_code)document.write(s_code);' . "\n";
			$t .= '}' . "\n";
		}
		$t .= '//-->' . "\n";
		$t .= '</script>' . "\n";
		$t .= '<script language="javascript" type="text/javascript">' . "\n";
		$t .= '<!--' . "\n";
		$t .= 'if(navigator.appVersion.indexOf(\'MSIE\')>=0)document.write(unescape(\'%3C\')+\'\!-\'+\'-\')' . "\n";
		$t .= '//-->' . "\n";
		$t .= '</script>' . "\n";
		
		return $t;
	}
	
}